<template>
    <Modal
        v-model="modal"
        width="1200px"
        title="推荐人选择"
        :loading="loading"
        :footer-hide="true"
        @on-ok="asyncOK">
        <IndexSelect v-if="modal" useType="refere" ref="indexSelect" :selectedMember="true" :berefereId="berefereId" :selectedList="selectedList" @callback="handleSelectSingle"/>
    </Modal>
</template>
<script>
    import IndexSelect from '../indexSelect.vue'

    export default {
        components: {
            IndexSelect
        },
        data () {
            return {
                modal: false,
                loading: true,
                selectedList: [],
                berefereId: ''
            }
        },
        methods: {
            show(selectedList = [], berefereId) {
                this.selectedList = selectedList
                this.berefereId = berefereId
                this.$nextTick(()=>{
                    this.modal = true
                })
            },
            handleSelectSingle(row) {
                this.selectedList = [row]
                this.$emit('singleSelect', row)
                this.modal = false;
            },
            asyncOK () {
                this.modal = false;
            }
        }
    }
</script>
